package com.eqdd.yiqidian.test;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by lv on 17-9-14.
 */

public class ExpandBean implements Parcelable {
   private int id;
   private int pid;
   private String label;
   private boolean isCheck=false;
   private int level=0;
   private boolean isExpand;
   private boolean isLeaf;
   private ExpandBean nextBean;
   private ExpandBean expandBean;
   private ExpandBean originNextBean;

    public ExpandBean getOriginNextBean() {
        return originNextBean;
    }

    public void setOriginNextBean(ExpandBean originNextBean) {
        this.originNextBean = originNextBean;
    }

    public boolean isExpand() {
        return nextBean!=expandBean;
    }

    public boolean isLeaf() {
        return isLeaf;
    }

    public void setLeaf(boolean leaf) {
        isLeaf = leaf;
    }

    public ExpandBean getNextBean() {
        return nextBean;
    }

    public void setNextBean(ExpandBean nextBean) {
        this.nextBean = nextBean;
    }

    public ExpandBean getExpandBean() {
        return expandBean;
    }

    public void setExpandBean(ExpandBean expandBean) {
        this.expandBean = expandBean;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getPid() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public boolean isCheck() {
        return isCheck;
    }

    public void setCheck(boolean check) {
        this.isCheck = check;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.id);
        dest.writeInt(this.pid);
        dest.writeString(this.label);
        dest.writeByte(this.isCheck ? (byte) 1 : (byte) 0);
        dest.writeInt(this.level);
        dest.writeByte(this.isExpand ? (byte) 1 : (byte) 0);
        dest.writeByte(this.isLeaf ? (byte) 1 : (byte) 0);
    }

    public ExpandBean() {
    }

    protected ExpandBean(Parcel in) {
        this.id = in.readInt();
        this.pid = in.readInt();
        this.label = in.readString();
        this.isCheck = in.readByte() != 0;
        this.level = in.readInt();
        this.isExpand = in.readByte() != 0;
        this.isLeaf = in.readByte() != 0;

    }

    public static final Parcelable.Creator<ExpandBean> CREATOR = new Parcelable.Creator<ExpandBean>() {
        @Override
        public ExpandBean createFromParcel(Parcel source) {
            return new ExpandBean(source);
        }

        @Override
        public ExpandBean[] newArray(int size) {
            return new ExpandBean[size];
        }
    };
}
